/*
 * @Author: 王灿
 * @Date: 2019-10-27 19:12:09
 * @Description: file content
 */
import Vue from 'vue'
import store from '../store'

// 获取数据字典
Vue.prototype.$getDataDic = key => {
  const dic = store.getters.dataDic
  let value
  // 如果key为空 则返回整个数据字典
  if (!key) {
    return dic
  }
  if (dic !== '') {
    value = dic[key]
  } else {
    console.error(`未在数据字典中找到${key}`)
    value = dic
  }

  return value
}
